//
//  CPUDetailModel.m
//  CPU_Utility
//
//  Created by leonardo on 15/10/14.
//  Copyright © 2015年 leonardo. All rights reserved.
//

#import "CPUDetailModel.h"
#import <MJExtension.h>
//@interface CPUDetailModelCell:BaseModel
//proStr(id)
//proStr(name)
//proStr(value)
//@end
//@interface  CPUDetailModelSection:BaseModel
//proStr(name)
//@property(nonatomic,strong) CPUDetailModelCell * paramArr ;
//@end
//@interface CPUDetailModel : BaseModel
//
//@end
@implementation CPUDetailModelCell

- (instancetype)init
{
    self = [super init];
    if (self) {
        [CPUDetailModelCell setupReplacedKeyFromPropertyName:^NSDictionary *{
            return @{
                    @"ID":@"id"
                     };
        }];
        
    }
    return self;
}

-(id)newValueFromOldValue:(id)oldValue property:(MJProperty *)property{
    if ([property.name isEqualToString:@"name"]) {
        if([oldValue isEqualToString: @"主频"]) return @"CPU主频";
        if ([oldValue isEqualToString:@"热设计功耗(TDP)"]) return @"工作功率";
        if ([oldValue isEqualToString:@"最大Turbo频率"]) return @"最大睿频";
        if ([oldValue isEqualToString:@"针脚数"]) return @"针脚数目";
        if ([oldValue isEqualToString:@"L3缓存"]) return @"三级缓存";
    }
    return oldValue;
}
@end

@implementation CPUDetailModelSection

- (instancetype)init
{
    self = [super init];
    if (self) {
        [CPUDetailModelSection setupObjectClassInArray:^NSDictionary *{
            return @{
                     @"paramArr":@"CPUDetailModelCell"
                     };
        }];
    }
    return self;
}

@end


@implementation CPUDetailModel
- (instancetype)init
{
    self = [super init];
    if (self) {
       [CPUDetailModel setupObjectClassInArray:^NSDictionary *{
           return @{
                    @"items":@"CPUDetailModelSection"
                    };
       }];
    }
    return self;
}

@end
